package com.atguigu.servlets;

import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * liujianlong
 * 2022-01-22 21:34
 */
//演示Servlet生命周期
public class Demo02 extends HttpServlet {
    //服务器内部自动实例化
    public Demo02(){
        System.out.println("正在实例化。。。");
    }

    @Override
    public void init()throws ServletException {
        System.out.println("正在初始化。。");
    }

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{
        System.out.println("正在服务。。");
    }

    @Override
    public void destroy(){
        System.out.println("正在销毁。。");
    }
}
